Skip to content

fix(connectors): reuse the GitHub App OAuth client for the github connector - #7955

Merged
harshithmullapudi merged 1 commit into
mainfrom
northern-hare-ca02a5d4
Sep 30, 2026
Merged

harshithmullapudi merged 1 commit into
mainfrom
northern-hare-ca02a5d4

Conversation

@harshithmullapudi

@harshithmullapudi harshithmullapudi commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Point the github connector's requires_env at GH_APP_CLIENT_ID / GH_APP_CLIENT_SECRET instead of PLUGIN_GITHUB_CLIENT_ID / PLUGIN_GITHUB_CLIENT_SECRET.
  • Drop the now-unused PLUGIN_GITHUB_* pair from both env templates and both deploy workflows.

Why / Context

Connecting the GitHub plugin fails in production. The github connector declares:

"requires_env": ["PLUGIN_GITHUB_CLIENT_ID", "PLUGIN_GITHUB_CLIENT_SECRET"],

and connectorEnv() (packages/trpc/src/lib/connectors/index.ts:71) throws on any falsy value:

Connector "github" needs PLUGIN_GITHUB_CLIENT_ID, PLUGIN_GITHUB_CLIENT_SECRET, which are unset.

Neither secret has ever existed. There are zero PLUGIN_* secrets in superset-sh/superset — not repo-level (88 secrets), not in the Production environment (62), not in Preview. The api Vercel project holds only GITHUB_TOKEN and YC_DEALS_WEBHOOK_SECRET. Both workflows wired the pair correctly (env: block and --env flag), so they faithfully passed empty strings through.

This went unnoticed because neither name appears in any env schema — packages/trpc/src/env.ts declares only PLUGIN_CLIENT_METADATA_BASE_URL, and as .optional(). The API boots clean and fails only when a user clicks Connect, which is exactly the silent-failure mode docs/environment-variables.md step 2 warns about.

GH_APP_CLIENT_ID / GH_APP_CLIENT_SECRET are already real repo secrets, already in the env schema, already in both templates with fake local values, and already passed to the API by both deploy workflows. Reusing them fixes the connector with no new secret and no new plumbing.

How It Works

clientCredentials() derives the secret's name from the id's, so the rename needs no code change:

const idName = method.requires_env.find((n) => n.endsWith("_CLIENT_ID"));
const secretName = idName.replace(/_CLIENT_ID$/, "_CLIENT_SECRET");

GH_APP_CLIENT_ID → GH_APP_CLIENT_SECRET, both resolved from process.env.

The env-var checklist in docs/environment-variables.md is satisfied in both directions: the removed pair is gone from all five places (it only ever reached places 3 and 5), and the newly-referenced pair is already present in all five.

⚠️ Required manual step before this works

The GitHub App must list the connector callback URL. Add

https://api.boid.so/api/connectors/callback/github

to the Superset GitHub App's callback URLs (Apps support up to 10). Without it the redirect fails with The redirect_uri MUST match the registered callback URL. This PR cannot do that — it is a GitHub App setting.

Production also needs a redeploy after merge to pick up the changed connectors.json.

Known Limitations

  • GitHub Apps ignore the scope parameter. The connector still declares "scopes": ["repo", "read:org", "workflow"], but a GitHub App's user-authorization flow derives access from the App's configured permissions and its installations, not from classic OAuth scopes. So that scopes array becomes dead config, and the resulting user token can only reach repositories where the Superset App is installed — narrower than a classic OAuth app would grant. If the GitHub plugin's MCP server (https://api.githubcopilot.com/mcp/) needs broader reach, the right fix is a dedicated OAuth app plus setting the PLUGIN_GITHUB_* secrets, i.e. reverting this PR. I left scopes in place rather than deleting it, to keep that revert clean.
  • GitHub App user tokens expire (8 hours) when token expiration is enabled on the App. refresh.ts handles the refresh grant against the same token_url, but this path has not been exercised in production.
  • GH_APP_CLIENT_ID stays .optional() in the schema. That matches SENTRY_CLIENT_ID and MICROSOFT_CLIENT_ID, and MissingConnectorEnvError already gives a clear failure, so I did not promote it to required.

Testing

  • bun run lint — clean (8828 files)
  • bunx turbo typecheck --filter=@superset/shared --filter=@superset/trpc — 3/3 successful
  • bun test packages/shared/src/connectors packages/trpc/src/lib/connectors — 44 pass, 0 fail (includes the registry-schema validation of connectors.json)
  • bun run check:plugins — "All plugins are valid and published"

Not verified: the OAuth flow end to end. That needs the callback URL registered on the GitHub App and a production deploy, neither of which I can do from here. I also did not run a YAML linter (actionlint is not installed); the workflow edits are four two-line deletions from the middle of flat lists, and the --env shell continuation chain stays intact on both sides of each deletion.

Manual QA Checklist

  • Callback URL added to the GitHub App
  • Production redeployed
  • Plugins → GitHub → Connect completes the OAuth round trip
  • The connection lists the expected account under the right identity ($.login)
  • A GitHub plugin tool call succeeds against a repo where the App is installed
  • A repo where the App is not installed fails in a legible way rather than hanging
  • Preview deploy: confirm whether the App's callback list needs the preview origin too

Risks / Rollout

  • Risk: low blast radius — the connector is already 100% broken, so the worst case is that it stays broken in a different way. No other consumer reads PLUGIN_GITHUB_*. The GitHub App's existing sign-in and repo-integration flows are untouched; this only adds a second consumer of the same client credentials.
  • Rollout: merge → add the callback URL → redeploy production → connect once to verify.
  • Rollback: revert the commit and redeploy. If the App-permissions model proves too narrow (see Known Limitations), the forward fix is a dedicated GitHub OAuth app with PLUGIN_GITHUB_* set as secrets — the revert restores exactly that wiring.

Summary by cubic

Fixes the GitHub connector, which threw MissingConnectorEnvError on every connect because PLUGIN_GITHUB_CLIENT_ID and PLUGIN_GITHUB_CLIENT_SECRET were never set as repository secrets. The connector now reuses the existing GH_APP_CLIENT_ID / GH_APP_CLIENT_SECRET pair, and the unused PLUGIN_GITHUB_* pair is dropped from the env templates and both deploy workflows.

Required before this works

  • Register https://api.boid.so/api/connectors/callback/github as a callback URL on the Superset GitHub App, then redeploy production.

Known limitations

  • GitHub Apps ignore the scope parameter, so the declared scopes are dead config and access is limited to repos where the App is installed.
  • GitHub App user tokens expire after 8 hours; the refresh path exists but hasn't been exercised in production.

Written for commit acb4bf3. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Updates
    • GitHub connector authentication now uses GitHub App credentials instead of the previous connector-specific credentials.

…nector

PLUGIN_GITHUB_CLIENT_ID and PLUGIN_GITHUB_CLIENT_SECRET were never set as
GitHub secrets, so both deploy workflows passed empty strings and
connectorEnv() threw MissingConnectorEnvError on every attempt to connect
the GitHub plugin. GH_APP_CLIENT_ID and GH_APP_CLIENT_SECRET already exist
as repo secrets and already reach the API through both workflows, so point
requires_env at them and drop the unused pair from the templates and the
deploy plumbing.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 18db21a8-6509-4022-99d9-26e25bba6e49

📥 Commits

Reviewing files that changed from the base of the PR and between f8ca1ba and acb4bf3.

📒 Files selected for processing (5)
  • .env.example
  • .env.local.example
  • .github/workflows/deploy-preview.yml
  • .github/workflows/deploy-production.yml
  • packages/shared/src/connectors/connectors.json
 _________________________________________________________
< Nuke the bugs from orbit. It's the only way to be sure. >
 ---------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@expo

expo Bot commented Sep 30, 2026

Copy link
Copy Markdown

No installed development build can load this pull request as an update: its native fingerprint is 7084d376924a and no development build has it. Add the mobile-build label to build one.

@harshithmullapudi
harshithmullapudi merged commit f70b1bc into main Sep 30, 2026
19 of 21 checks passed
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) ✅ View Branch
Vercel API (Vercel) ✅ Open Preview
Vercel Web (Vercel) ✅ Open Preview
Vercel Marketing (Vercel) ✅ Open Preview
Vercel Admin (Vercel) ✅ Open Preview
Vercel Docs (Vercel) ✅ Open Preview

Preview updates automatically with new commits

Kitenite added a commit that referenced this pull request Oct 1, 2026
* docs: weekly update for PRs merged 2026-09-23 to 2026-09-30

Source of truth: live Notion SOP "Weekly Docs Update (automation SOP)".
Window: merged:>=2026-09-23 (139 PRs). PRs through the morning of 09-23
were covered by #7771.

Changes
- Pages: no auto-open on publish (#7790); page links and URL links split
  into their own settings (#7916, #7962, #7946); Listening agents menu with
  per-row stop and Add listening agent (#7724, #7820, #7919); globe on the
  Share button (#7766); Report on public pages (#7886); agents offer a page
  (#7759). Files: pages.mdx, cli/cli-reference.mdx.
- Settings moves: Links replaced by Browser and Files & Editor (#7916,
  #7962). Files: editor.mdx, terminal-integration.mdx, customization.mdx.
- Editor: inline rename and drag to move (#7692), Auto Save (#7693, #7916),
  open and save files outside the workspace (#7897, #7982), Copy as Markdown
  (#7591), per-pane error screen (#7983). File: editor.mdx.
- Terminal copy follows Ghostty's whitespace rules (#7868).
  File: terminal-integration.mdx.
- Agents: UFO (#7898); GPT-6 Astra, Sonnet 5.5, retiring GPT-5.5, retired
  GPT-5.4/5.3 Codex (#7783, #7894, #7935). Files: agent-integration.mdx,
  cli/cli-reference.mdx.
- Host: superset start --daemon --auto-update and update-lock permission
  errors (#7735, #7952). Files: cli/host-server.mdx, cli/cli-reference.mdx.
- Removed the mcp CLI section and the Connected Service Plugins section:
  #7776 made plugins/mcp internal, the Plugins page is staff-flagged, and
  apps/docs/AGENTS.md keeps internal commands out. Files: skills.mdx,
  cli/cli-reference.mdx.
- Slack page unfurls and details panel (#7817, #7821, #7914, #7957).
  File: use-with-slack.mdx.
- Workspaces: instant creation with background naming (#7518); recoverable
  project deletion (#7896). File: workspaces.mdx.
- Shortcuts: prev/next workspace includes Pinned and wraps (#7851); ⌘B
  collapses the sidebar to a rail (#7964). File: keyboard-shortcuts.mdx.
- Ship controls and open-in button moved to the right sidebar strip (#7958).
  Files: diff-viewer.mdx, use-with-ide.mdx.

Deliberately skipped
- Cloud workspaces/environments/sandboxes (flag-gated, AGENTS.md rule):
  #7784 #7795 #7824 #7840 #7844 #7845 #7847 #7849 #7850 #7858 #7861 #7863
  #7874 #7911 #7913 #7918 #7922 #7931 #7932 #7937 #7956 #7961 #7969 #7981
  #7637 #7794 #7789 #7838 (its CLI docs already shipped in the PR).
- Staff-only plugins: #7912 Sentry plugin, #7716, #7727, #7955.
- Already documented in their own PRs: #7917, #7921.
- Removed feature never documented: #7796 Google Calendar triggers.
- Agents chip remove/revert/default-off, never documented: #7870 #7871 #7872.
- Billing/backend policy with no docs surface: #7947, #7812, #7786, #7792,
  #7798, #7761, #7948, #7949, #7951, #7827.
- Reverted security trio: #7828 #7829 #7830 (reverted by #7834).
- Fixes restoring expected behavior: #7683 #7696 #7707 #7743 #7751 #7756
  #7764 #7765 #7781 #7788 #7791 #7823 #7825 #7833 #7837 #7852 #7857 #7860
  #7864 #7865 #7869 #7873 #7897-covered #7903 #7938 #7980 #7943 #7964-chrome.
- Mobile (no docs page): #7746 #7747 #7748 #7749 #7750 #7782 #7793 #7810
  #7814 #7816 #7889 #7968.
- Marketing, internal docs, CI, version bumps: #7651 #7744 #7752 #7771 #7774
  #7776-infra #7777 #7785 #7811 #7818 #7822 #7826 #7834 #7884 #7885 #7895
  #7909 #7933 #7934 #7942 #7944 #7965 #7966.

Validation: bun run --cwd apps/docs typecheck, bun run lint:fix,
bun run lint (exit 0), Vale on 13 changed files (0 errors, 0 warnings),
git diff --check.

* chore: log weekly docs update follow-ups

* docs: tighten review findings in the weekly update

Only the page creator can stop or add listening agents. On focus change also
saves on window blur, and Auto Save pauses on conflicts. Taken-down pages do
not unfurl. Model picker coverage matches agent-models.ts.

This branch was previously deployed

1 inactive deployment
preview — acb4bf34 Deployed Sep 30, 2026 by harshithmullapudi via Deploy Admin #10594
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant